package edu.ccut.titan.tag.report.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import edu.ccut.titan.tag.report.design.ColumnGroupInfo;

public class TitanColumngroupTag extends TagSupport {
	private static final long serialVersionUID = -5547713365039016384L;
	private String filed = "";
	private String clazz = "java.lang.String";
	private String totalHeader = "合计";
	private String width = "50";
	private String height = "20";
	private String alignment = "center";
	private String font = "blob";
	private TitanCrosstabTag crosstabTag;
	private ColumnGroupInfo columnGroupInfo;

	@Override
	public int doStartTag() throws JspException {
		crosstabTag = (TitanCrosstabTag) this.getParent();
		columnGroupInfo = new ColumnGroupInfo();
		return EVAL_BODY_INCLUDE;
	}

	@Override
	public int doEndTag() throws JspException {
		columnGroupInfo.setAlignment(alignment);
		columnGroupInfo.setClazz(clazz);
		columnGroupInfo.setFiled(filed);
		columnGroupInfo.setFont(font);
		columnGroupInfo.setHeight(height);
		columnGroupInfo.setTotalHeader(totalHeader);
		columnGroupInfo.setWidth(width);
		crosstabTag.addColumnGroupInfo(columnGroupInfo);
		return SKIP_BODY;
	}

	public String getFiled() {
		return filed;
	}

	public void setFiled(String filed) {
		this.filed = filed;
	}

	public String getClazz() {
		return clazz;
	}

	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	public String getTotalHeader() {
		return totalHeader;
	}

	public void setTotalHeader(String totalHeader) {
		this.totalHeader = totalHeader;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	public String getAlignment() {
		return alignment;
	}

	public void setAlignment(String alignment) {
		this.alignment = alignment;
	}

	public String getFont() {
		return font;
	}

	public void setFont(String font) {
		this.font = font;
	}

}
